function [y] = speed_calc(t, x, y, acceleration_calc)
h = 0.1 %Stepsize

%Get first derivative
f1 = acceleration_calc(x, a);
f2 = acceleration_calc(x + h/2, a + h*f1/2);
f3 = acceleration_calc(x + h/2, a + h*f2/2);
f4 = acceleration_calc(x + h, a+h*f3);
y = h*(f1 + 2*f2 + 2*f3 + f4)/6;